package com.huabo.contract.mysql.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.ORDER;

/**
 * <p>
 * 
 * </p>
 *
 * @author huabo
 * @since 2021-10-27
 */
@Data
  @EqualsAndHashCode(callSuper = false)
@Table(name = "TBL_ATTACHMENT")
@ApiModel(value="TblAttachmentMySql对象", description="")
public class TblAttachmentMySql implements Serializable {

    private static final long serialVersionUID = 1L;

      @ApiModelProperty(value = "主键Id 自增")
      @Id
      //@GeneratedValue(strategy = GenerationType.IDENTITY,generator = "select ATTCHMENT_SEQUENCE.nextval from dual")  
      @TableId("ATTID")
      @KeySql(sql = "select ATTCHMENT_SEQUENCE.nextval from dual", order= ORDER.DEFAULT)
      private BigDecimal attid;

      @ApiModelProperty(value = "附件名称")
      @TableField("ATTNAME")
    private String attname;

      @ApiModelProperty(value = "附件路径")
      @TableField("ATTPATH")
    private String attpath;

      @ApiModelProperty(value = "附件大小")
      @TableField("ATTSIZE")
    private double attsize;

      @ApiModelProperty(value = "备注")
      @TableField("MEMO")
    private String memo;

      @ApiModelProperty(value = "上传时间")
      @TableField("UPLOADTIME")
      @JSONField(format = "yyyy-MM-dd HH:mm:ss")
      @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date uploadtime;

      @ApiModelProperty(value = "上传人")
      @TableField("UPLOADER")
    private String uploader;

      @ApiModelProperty(value = "是否是python爬取文件 0是")
      @TableField("ISPYTHONFLAG")
    private String ispythonflag;

      @Transient
      private String filename;
      @Transient
      private String contentText;
}
